package com.aizuda.snailjob.core;

import lombok.Data;
import lombok.Getter;

import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.atomic.AtomicLong;

@Getter
public class Collector {

    private final NamespaceCollector namespaceCollector = new NamespaceCollector();

    private final GroupConfigCollector groupConfigCollector = new GroupConfigCollector();

    private final JobCollector jobCollector = new JobCollector();


    @Data
    public static class NamespaceCollector {

        // 总的数据量
        private long total = 1;

        // 成功迁移多少
        private AtomicLong success = new AtomicLong(0);

        // 成功迁移多少
        private AtomicLong error = new AtomicLong(0);
    }

    @Data
    public static class GroupConfigCollector {
        // 总的数据量
        private long total;

        // 成功迁移多少
        private AtomicLong success = new AtomicLong(0);

        // 迁移失败多少
        private AtomicLong error = new AtomicLong(0);
    }

    @Data
    public static class JobCollector {

        // 总的数据量
        private long total;

        // 成功迁移多少
        private AtomicLong success = new AtomicLong(0);

        // 迁移失败多少
        private AtomicLong error = new AtomicLong(0);

    }

}




